<?php

class Application_Model_File extends Application_Model_Abstract {

    protected $description;

    public function __construct() {
        $this->_dbTable = new Application_Model_DbTable_File();
    }

    public function search($searchValue) {
//        $select = $this->_dbTable->select('description, path, updated_at' )
//                ->where('description LIKE("?")', new Zend_Db_Expr('%' . $searchValue . '%'));
//
//        $result = $this->_dbTable->fetchAll($select);
//        print_r($result[0]);

        $stmt = Zend_Db_Table::getDefaultAdapter()->query('SELECT description, path, created_at, updated_at, name FROM file where description like \'%' . $searchValue . '%\' or name like \'%' . $searchValue . '%\'');
        $result = $stmt->fetchAll();
        //print_r($result);
        
        return ($result);

    }

}

